<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="com.doone.telmarket.domain.ServicePage"%><html>
<head>
<title>管理中心</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Insert title here</title>
<script src="${pageContext.request.contextPath}/js/jquery.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/jquery.ui.draggable.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/jquery.alerts.js" type="text/javascript"></script>
<link href="${pageContext.request.contextPath}/css/jquery.alerts.css" rel="stylesheet" type="text/css" media="screen" />
<script src="${pageContext.request.contextPath}/js/common.js"
	type="text/javascript"></script>
<link rel="stylesheet" rev="stylesheet"
	href="${pageContext.request.contextPath}/css/admin/style-admin.css"/>
<script type="text/javascript">
$(document).ready(function(){
	$("#saveService").click(function(){
		$.ajax({
		    url: document.getElementById("contextPath").value+'/admin/saveOpration?saveType=<%=request.getParameter("saveType")  %>',
		    type: 'POST',
		    timeout: 5000,
		    error: function(){
		    	jAlert('获取数据失败','消息');
		    },
		    success: function(msg){
		    	jAlert(msg,'消息');
		        if(msg!="生成页面失败"){
		        	$("#saveService").remove();
		        	document.getElementById("browsePage").style.display="none";
		        	document.getElementById("clean").style.display="none";
				}	
		    }
		});
		
	});
});
function cancelOpration(){
	document.getElementById("cancelForm").submit();
}
</script>
</head>
<body>
  <div><h1>操作成功</h1></div><input  type="hidden"  id="contextPath" value="${pageContext.request.contextPath}">
<%
	String url ="";
	if(request.getAttribute("page")==null){
		url = "service/service.jsp";
	}else{
		url = request.getAttribute("page").toString();
	}
%>
 <input type="button" class="button" value="返回" onclick="window.location.href='${pageContext.request.contextPath}/admin/<%=url %>'">
  <%
  	if(session.getAttribute("servicePage")!=null){
  		ServicePage servicePage = (ServicePage)session.getAttribute("servicePage");
  		%> 
  		  <input type="button" id="browsePage" class="button" value="预览页面" onclick="window.open('${pageContext.request.contextPath}/admin/serviceTemplet.jsp')"> 
  		　<input type="button" value="生成页面"  class="button" id="saveService"><input type="button" name="Submit2" 
								id="clean"	value="清空配置" class="button" onclick="cancelOpration();"/> 
  		<%
  	}
  %>
  <form action="${pageContext.request.contextPath}/admin/cancelOprationService" method="post" id="cancelForm"></form>
</body>
</html>